//
//  FindSelfVC.m
//  Bread-Live
//
//  Created by wy on 2017/3/11.
//  Copyright © 2017年 Chris. All rights reserved.
//

#import "FindSelfVC.h"
#import "UserHeadView.h"

@interface FindSelfVC ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,strong) UserHeadView *headView;
@property(nonatomic,strong) UITableView *wTableView;

@end

@implementation FindSelfVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self.wTableView reloadData];
}


-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 7;
    
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 5.0;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString *cellID = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell ==nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    
    cell.textLabel.text  = [NSString stringWithFormat:@"%ld",indexPath.row];
    return cell;
}

-(UITableView *)wTableView{
    if (!_wTableView) {
        _wTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0,kWidth , kHeight-64) style:UITableViewStyleGrouped];
        _wTableView.delegate = self;
        _wTableView.dataSource = self;
        _wTableView.tableHeaderView = self.headView;
        [self.view addSubview:_wTableView];
    }
    return _wTableView;
}

-(UserHeadView *)headView{
    if (!_headView) {
        
        _headView  = [[UserHeadView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kWidth/2)];
        
    }
    return _headView;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
